package tmproject.hlhj.fhp.cartrans.presenter

import android.content.Context
import com.example.mymvp.BasePresenter
import tmproject.hlhj.fhp.cartrans.IView.LoginView
import tmproject.hlhj.fhp.cartrans.javaBean.BaseBean
import tmproject.hlhj.fhp.cartrans.javaBean.LoginBean
import tmproject.hlhj.fhp.cartrans.modules.LoginModule

/**
 * Created by Administrator on 2018/8/11/011.
 */
class LoginPresenter:BasePresenter<LoginModule,LoginView>(), LoginModule.LoginResp {
    override fun createModule() {
        module= LoginModule()
        module.listener=this
    }

    override fun loginResult(loginBean: LoginBean) {
        view?.loginResp(loginBean)
    }

    fun sendSms(c:Context, phone:String){
        module.sendSms(c,phone)
    }

    override fun smsResp(baseBean: BaseBean) {
        view?.sendSmsResp(baseBean)
    }

    fun login(c:Context,mobile:String,sms_code:String){
        module.goLogin(c, mobile, sms_code)
    }
}